//
//  ZJShareIssueBaseView.m
//  ShangHaiHuDongApp
//
//  Created by ZJ on 2017/6/13.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "ZJShareIssueBaseView.h"

@interface ZJShareIssueBaseView ()
{
    CGFloat _width;
    
}
@end

@implementation ZJShareIssueBaseView

- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.titleLabel];
        self.titleLabel.text = title;
        _width = [CalculateLabelHeight CalculateLabelWidthWithString:title font:15 * [UIScreen zj_textFontScale] height:40 * [UIScreen zj_screenHScale]].width;
        [self addSubview:self.mustImageView];
        self.mustImageView.hidden = YES;
    }
    return self;
}



#pragma mark - Setter


#pragma mark - Getters
- (UILabel *)titleLabel{
    if (_titleLabel == nil){
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * [UIScreen zj_screenWScale], 0, [UIScreen zj_screenWith] - 30 * [UIScreen zj_screenWScale], 40 * [UIScreen zj_screenHScale])];
        _titleLabel.font = [UIFont titleTextFont];
        _titleLabel.textColor = [UIColor textBlackColor];
    }
    return _titleLabel;
}

- (UIImageView *)mustImageView{
    if (_mustImageView == nil) {
        _mustImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_width + 15 * [UIScreen zj_screenWScale], 8 * [UIScreen zj_screenHScale], 10 * [UIScreen zj_screenHScale], 10 * [UIScreen zj_screenHScale])];
        _mustImageView.image = [UIImage imageNamed:@"tishiL"];
        _mustImageView.contentMode = UIViewContentModeCenter;
    }
    return _mustImageView;
    
}


@end
